apt-get install mutt
apt-get install msmtp

touch ~/.muttrc
echo "set sendmail='/usr/bin/msmtp'
set use_from=yes
set realname='hujiangshui'
set from=799423779@qq.com
set envelope_from=yes" > ~/.muttrc

touch ~/msmtp.log

touch  ~/.msmtprc
echo "account default
host smtp.qq.com
from 799423779@qq.com
auth plain
user 799423779@qq.com
password QQ邮箱授权码
logfile ~/msmtp.log" > ~/.msmtprc

echo "test" |mutt -s "this is a test" janksen@foxmail.com
